4填空一棵有512个结点的完全二叉树的高度为多少?(独根树高度为1)Whatistheheightofacompletebinarytreewith512nodes?(theheightofatreewithonlyarootis1)
5填空在一棵非空二叉树中,若度为0的结点的个数n,度为2的结点个数为m,则有n=________(系统根据字符串匹配来判定答案,所以您的答案中请不要包含空格)Forabinarytreewithatleastonenode,iftherearennodeswithdegree0andmnodeswithdegree2,thenn=________(Thisproblemisjudgedbystringmatching,Pleasemakesureyouranswerdon’tcontainanyblanks.)
6填空已知一棵树的前序遍历为ABDEGCF,中序遍历为DBGEACF,求这棵树的后序遍历。(字母和字母之间不要有空格)ThepreordersequenceofatreeisABDEGCF,anditsinfixordersequenceisDBGEACF,pleasewritedownitspostordersequence.(Thereisnoblankspacebetweenletters)
7填空已知一棵树的中序遍历为DBGEACF,后序遍历为DGEBFCA,求这棵树的前序遍历。(字母和字母之间不要有空格)TheinfixordersequenceofatreeisDBGEACF,anditspostordersequenceisDGEBFCA,pleasewritedownitspreordersequence.(Thereisnoblankspacebetweenletters)
8填空请写出下面这棵二叉树的前序遍历(字母和字母之间不要有空格)Pleasewritedownthepreordersequenceofthefollowingbinarytree.(Thereisnoblankspacebetweenletters)
数据结构与算法
北京大学
军职在线答案
大学网课